<?php

declare (strict_types=1);
namespace App\Model;

use App\Traits\ModelLabelTrait;
use Hyperf\Database\Model\SoftDeletes;
use Hyperf\DbConnection\Model\Model;
/**
 * @property int $id 
 * @property string $mobile 
 * @property string $email 
 * @property string $code 
 * @property string $text 
 * @property int $type 
 * @property int $expire_time 
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 * @property string $deleted_at 
 */
class SmsCode extends Model
{
    use SoftDeletes,ModelLabelTrait;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'sms_code';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'mobile',
        'email',
        'code',
        'text',
        'type',
        'expire_time'
    ];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'int', 'type' => 'integer', 'expire_time' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    const TYPE_REGISTER=1;
    const TYPE_BINDPHONE=2;
    const TYPE_NOTIFICATION=3;

    const TYPE_LABELS=[
        self::TYPE_REGISTER => '注册',
        self::TYPE_BINDPHONE => '绑定',
        self::TYPE_NOTIFICATION => '通知'
    ];
}